package com.dys.service.impl;

import com.dys.dao.TeacherDao;
import com.dys.dao.impl.TeacherDaoImpl;
import com.dys.entity.Teacher;
import com.dys.service.TeacherService;

import java.util.List;

/**
 * @Author: 疾风
 * @ClassName: TeacherServiceImpl
 * @Description: 教师实现类
 * @CreateDate: 2024/10/11
 * @Version: v1.0.0
 */
public class TeacherServiceImpl implements TeacherService {
    private final TeacherDao teacherDao = new TeacherDaoImpl();

    @Override
    public List<Teacher> findTeachersByPage(int pageNo, int pageSize, String name, String phone) {
        return teacherDao.selectTeachersByPage(pageNo, pageSize, name, phone);
    }

    @Override
    public int findTeacherCount() {
        return teacherDao.selectTeacherCount();
    }

    @Override
    public int deleteTeacherInfo(int tid) {
        return teacherDao.deleteOneTeacherInfo(tid);
    }

    @Override
    public int saveTeacherInfo(Teacher teacher) {
        return teacherDao.saveOneTeacherInfo(teacher);
    }

    @Override
    public int updateTeacherInfo(Teacher teacher) {
        return teacherDao.updateOneTeacherInfo(teacher);
    }

    @Override
    public Teacher findOneTeacherInfo(int tid) {
        return teacherDao.selectOneTeacherInfo(tid);
    }
}
